package com.mims.remote;

public class SmsServiceRemoteProxy implements com.mims.remote.SmsServiceRemote {
  private String _endpoint = null;
  private com.mims.remote.SmsServiceRemote smsServiceRemote = null;
  
  public SmsServiceRemoteProxy() {
    _initSmsServiceRemoteProxy();
  }
  
  public SmsServiceRemoteProxy(String endpoint) {
    _endpoint = endpoint;
    _initSmsServiceRemoteProxy();
  }
  
  private void _initSmsServiceRemoteProxy() {
    try {
      smsServiceRemote = (new com.mims.remote.SmsServiceRemoteServiceLocator()).getSmsServiceRemotePort();
      if (smsServiceRemote != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)smsServiceRemote)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)smsServiceRemote)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (smsServiceRemote != null)
      ((javax.xml.rpc.Stub)smsServiceRemote)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public com.mims.remote.SmsServiceRemote getSmsServiceRemote() {
    if (smsServiceRemote == null)
      _initSmsServiceRemoteProxy();
    return smsServiceRemote;
  }
  
  public java.lang.String sends(java.lang.String[] mobileNumbers, java.lang.String content, java.lang.String sendDate, java.lang.String sender, java.lang.String account, java.lang.String authorizationCode) throws java.rmi.RemoteException, com.mims.remote.Exception{
    if (smsServiceRemote == null)
      _initSmsServiceRemoteProxy();
    return smsServiceRemote.sends(mobileNumbers, content, sendDate, sender, account, authorizationCode);
  }
  
  public java.lang.String querySmsHistory(java.lang.String phoneNo, java.lang.String sender, java.lang.String account, java.lang.String authorizationCode) throws java.rmi.RemoteException, com.mims.remote.Exception{
    if (smsServiceRemote == null)
      _initSmsServiceRemoteProxy();
    return smsServiceRemote.querySmsHistory(phoneNo, sender, account, authorizationCode);
  }
  
  public java.lang.String sendsByShortNumber(java.lang.String[] mobileNumbers, java.lang.String content, java.lang.String sendDate, java.lang.String sender, java.lang.String shortNumber, java.lang.String account, java.lang.String authorizationCode) throws java.rmi.RemoteException, com.mims.remote.Exception{
    if (smsServiceRemote == null)
      _initSmsServiceRemoteProxy();
    return smsServiceRemote.sendsByShortNumber(mobileNumbers, content, sendDate, sender, shortNumber, account, authorizationCode);
  }
  
  public java.lang.String sendByShortNumber(java.lang.String mobileNumber, java.lang.String content, java.lang.String sendDate, java.lang.String sender, java.lang.String shortNumber, java.lang.String account, java.lang.String authorizationCode) throws java.rmi.RemoteException, com.mims.remote.Exception{
    if (smsServiceRemote == null)
      _initSmsServiceRemoteProxy();
    return smsServiceRemote.sendByShortNumber(mobileNumber, content, sendDate, sender, shortNumber, account, authorizationCode);
  }
  
  public java.lang.String send(java.lang.String mobileNumber, java.lang.String content, java.lang.String sendDate, java.lang.String sender, java.lang.String account, java.lang.String authorizationCode) throws java.rmi.RemoteException, com.mims.remote.Exception{
    if (smsServiceRemote == null)
      _initSmsServiceRemoteProxy();
    return smsServiceRemote.send(mobileNumber, content, sendDate, sender, account, authorizationCode);
  }
  
  public java.lang.String querySms(java.lang.String recordid, java.lang.String account, java.lang.String authorizationCode) throws java.rmi.RemoteException, com.mims.remote.Exception{
    if (smsServiceRemote == null)
      _initSmsServiceRemoteProxy();
    return smsServiceRemote.querySms(recordid, account, authorizationCode);
  }
  
  
}